package com.ny.service.impl;

import com.ny.dao.StudentDao;
import com.ny.dao.impl.StudentDaoImpl;
import com.ny.entity.Student;
import com.ny.service.StudentService;

import java.sql.SQLException;

public class StudentServiceImpl implements StudentService {
    private StudentDao  studentDao = new StudentDaoImpl();

    @Override
    public Student login(String name, String password) throws Exception {

        return studentDao.login(name, password);
    }

    @Override
    public int insertStudent(Student student) throws SQLException, ClassNotFoundException {
        return studentDao.insertStudent(student);
    }

    @Override
    public int updateStudent(Student student) throws SQLException, ClassNotFoundException {
        return studentDao.updateStudent(student);
    }
}
